package rs.frenjoynet.core.ui.util;

import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.ScopeType;
import org.richfaces.component.html.HtmlModalPanel;

/**
 * Created by IntelliJ IDEA.
 * User: ppopovic
 * Date: 28.10.2009.
 * Time: 15.40.54
 * To change this template use File | Settings | File Templates.
 */
@Name ("errorHandling")
@Scope (ScopeType.EVENT)
public class ErrorHandling
{
	private HtmlModalPanel popup;
		private String message;

		public HtmlModalPanel getPopup()
		{
			return popup;
		}

		public void setPopup(HtmlModalPanel popup)
		{
			this.popup = popup;
		}

		public String getMessage()
		{
			return message;
		}

		public void setMessage(String message)
		{
			this.message = message;
		}

		public void errorForModalPanel(String message)
		{
			this.message = message;
			getPopup().setRendered(true);
			getPopup().setShowWhenRendered(true);
		}
	
}
